<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="${adminAssetsUrl}/css/base.css">
    <link rel="stylesheet" type="text/css" href="${adminAssetsUrl}/themes/bootstrap/easyui.css">
    <link rel="stylesheet" type="text/css" href="${adminAssetsUrl}/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="${adminAssetsUrl}/css/common.css">
    <script type="text/javascript" src="${adminAssetsUrl}/js/jquery.min.js"></script>
    <script type="text/javascript" src="${adminAssetsUrl}/js/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="${adminAssetsUrl}/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript" src="${adminAssetsUrl}/js/common.js"></script>
    <style>
        #header{background:#B3DFDA;height:60px; }
    </style>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" id="header">
    <div style="width: 300px;float: left"><span style="font-weight:bold;line-height:60px;font-size:18px;display: block;">上海卓领通用后台管理系统</span></div>
    <div style="float: right;padding: 5px">
        <span style="line-height: 50px">
            欢迎 ${sessionUser.username}!&nbsp;&nbsp;&nbsp;
            <a href="${ctx}/admin/common/logout.do" style="color: blue"><span class="am-icon-power-off"></span> 退出</a>
        </span>
    </div>
</div>
<div data-options="region:'west',split:true,collapsed:false,title:' '" style="width:10%;">
    <div class="easyui-accordion" data-options="fit:true,border:false">
        <% for(menu in menus) {%>
        <!--打印根目录-->
        <% if(menu.isShow && !menu.isLeaf) {%>
        <div title="${menu.name}" style="padding:0px;">
            <ul id="index-left-menu">
                <% for(subMenu in menu.children) {%>
                <%if(subMenu.isShow) {%>
                <li>
                    <a href="javascript:void(0)"
                       onclick="addTab('${subMenu.name}','${ctx}${subMenu.url}?id=${subMenu.id}')">${subMenu.name}</a>
                </li>
                <%}%>
                <% }%>
            </ul>
        </div>
        <% }%>
        <% }%>
    </div>
</div>

</div>
<!--<div data-options="region:'east',split:false,collapsed:true,title:'常用'" style="width:100px;padding:10px;">-->
<!--</div>-->
<!--<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;text-align:center">-->
<!--<span style="line-height:50px;">版权所有-上海卓领通讯技术有限公司</span>-->
<!--</div>-->
<div data-options="region:'center',fit:false,border:false">
    <div class="easyui-tabs" style="width:100%;height:100%" id="tabs">
    </div>
</div>
</body>
<script>
    function addTab(title, href, icon) {
        var tt = $('#tabs');
        if (tt.tabs('exists', title)) {//如果tab已经存在,则选中并刷新该tab
            tt.tabs('select', title);
        } else {
            tt.tabs('addIframeTab', {
                tab: {
                    title: title,
                    closable: true,
                    //content: content,
                    iconCls: icon || 'icon-default',
                    tools: [{
                        iconCls: 'icon-mini-refresh',
                        handler: function () {
                            //刷新指定标题的tab页
                            tt.tabs('updateIframeTab', {
                                which: title,
                            });
                        }
                    }]
                },
                iframe: {src: href}
            });
        }
    }
</script>
</html>